/*
 * @Author: chentao
 * @Date: 2020-12-29 15:50:14
 * @Last Modified by: chentao
 * @Last Modified time: 2021-08-25 10:46:35
 */

import React, { useContext } from 'react';
import './HooksMessageStyle.less';
import ClassMessageComponent from '../../classComponents/message/ClassMessageComponent';
import context from '../../createContext';
function Message() {
  const { MessageContext, ContainerContext } = context;
  const messageContext = useContext(MessageContext);
  const containerContext = useContext(ContainerContext);
  console.log(
    '接收到的消息组件里面接收到父组件的contextProvider',
    containerContext
  );
  return (
    <MessageContext.Provider value={messageContext}>
      <div className="container">
        <div className="hookMessageTitle">
          <span>hooks_message_title</span>
        </div>
        <ClassMessageComponent />
      </div>
    </MessageContext.Provider>
  );
}
export default Message;
